package com.spring.trans.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 每一行代码，都是改变世界的力量
 *
 * @author 郭帅
 * @date 2021/12/25 5:39 下午
 */
@Component
public class AccountInfoDaoImpl implements AccountInfoDao {


    @Resource
    JdbcTemplate jdbcTemplate;

    public double updateAccountBalance(String accountId, double money) {
        String sql = "update account_info set money = %s where account_id = '%s'";
        jdbcTemplate.execute(String.format(sql, money, accountId));
        return 0L;
    }
}
